﻿using System.Windows.Forms;

namespace ruscehproj2
{
    public partial class bp116 : Form
    {
        byte modeState = 1;
        bool isActive = false;
        public bp116()
        {
            InitializeComponent();
        }

        public bool getState()
        {
            return isActive;
        }

        private void bp116_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Escape)
            {
                this.Hide();
            }
        }

        private void mode_Click(object sender, System.EventArgs e)
        {
            if (FormManager.BK007.getState())
            {
                modeState++;
                if (modeState > 4) modeState = 1;
                switch (modeState)
                {
                    case 1: mode.BackgroundImage = Resources.set5; break;
                    case 2: mode.BackgroundImage = Resources.set8; break;
                    case 3: mode.BackgroundImage = Resources.set15; break;
                    case 4: mode.BackgroundImage = Resources.set2; break;
                }
                if (modeState == 3)
                {
                    FormManager.hlp.setHelpId("end");
                    FormManager.hlp.hlpRefresh();
                    isActive = true;
                }
                else
                {
                    FormManager.hlp.setHelpId("10");
                    FormManager.hlp.hlpRefresh();
                }
            }
        }

        private void bp116_Load(object sender, System.EventArgs e)
        {
            if (FormManager.hlp.helpEnabled())
            {
                if (FormManager.BK007.getState())
                {
                    if (isActive)
                    {
                        FormManager.hlp.setHelpId("end");
                    }
                    else FormManager.hlp.setHelpId("10");
                    FormManager.hlp.hlpRefresh();
                }
                else
                {
                    FormManager.hlp.notSoFast();
                }



                FormManager.hlp.Show();
            }
        }

        private void bp116_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (isActive) FormManager.hlp.setHelpId("11");
            FormManager.hlp.Hide();
        }
    }
}
